package com.android.youwenchuang.ui.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.android.youwenchuang.R;
import com.android.youwenchuang.bean.Goods;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

public class SearchAdapter extends BaseQuickAdapter<Goods, BaseViewHolder> {
    public SearchAdapter() {
        super(R.layout.item_shop1);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, Goods item) {
        baseViewHolder.setText(R.id.tv_name, item.getName());
        baseViewHolder.setText(R.id.tv_price, "¥" + item.getPrice());
        ImageView ivImage = baseViewHolder.getView(R.id.iv_image);
        Glide.with(getContext())
                .load(item.getPics())
                .into(ivImage);
    }
}
